<div class="row">
	<div class="panel callout"><h6>New Grades</h6></div>
			<? if(isset($system_message)) echo $system_message;?>
			<?require 'grades_nav.php';?>
			<div class="panel"><h6><?=$subj_data->subj_code . ' (' . $subj_data->subj_desc . ')';?></h6></div>
				<?if(!empty($student_data)):?>
					<form action="<?=site_url(array('grades','new_grades',$subj_data->subj_id));?>" method="POST">
						<input type="submit" class="button small success" value="Add Grades"/>
						<table>
							<thead>
								<tr>
									<th rowspan="2">Student</th>
									<th colspan="4">Quarter</th>
									<th rowspan="2">Average</th>
									<th rowspan="2">Remarks</th>
								</tr>
								<tr>
									<th>1st</th>
									<th>2nd</th>
									<th>3rd</th>
									<th>4th</th>
								</tr>
							</thead>
							<tbody>
								<tr>
									<?foreach($student_data AS $sd):?>
									<?$id_arr[] = $sd->e_id;?>
										<td>
											<?=strtoupper($sd->lastname) . ', ' . ucwords($sd->firstname) . ' ' . ucwords($sd->middlename); ?>
										</td>
										<td>
											<input type="text" name="grades[<?=$sd->e_id?>][1]" id="<?=$sd->e_id . '_1';?>" value="" size="4" class="grade_input compute_ave" />
											<p class="<?=$sd->e_id . '_1';?>">NA</p>
											<input type="hidden" name="l_grades[<?=$sd->e_id?>][1]" value="" class="l_grades[<?=$sd->e_id?>][1]" />
										</td>
										<td>
											<input type="text" name="grades[<?=$sd->e_id?>][2]" id="<?=$sd->e_id . '_2';?>" value="" size="4" class="grade_input compute_ave" />
											<p class="<?=$sd->e_id . '_2';?>">NA</p>
											<input type="hidden" name="l_grades[<?=$sd->e_id?>][2]" value="" class="l_grades[<?=$sd->e_id?>][2]" />
										</td>
										<td>
											<input type="text" name="grades[<?=$sd->e_id?>][3]" id="<?=$sd->e_id . '_3';?>" value="" size="4" class="grade_input compute_ave" />
											<p class="<?=$sd->e_id . '_3';?>">NA</p>
											<input type="hidden" name="l_grades[<?=$sd->e_id?>][3]" value="" class="l_grades[<?=$sd->e_id?>][3]" />
										</td>
										<td>
											<input type="text" name="grades[<?=$sd->e_id?>][4]" id="<?=$sd->e_id . '_4';?>" value="" size="4" class="grade_input compute_ave" />
											<p class="<?=$sd->e_id . '_4';?>">NA</p>
											<input type="hidden" name="l_grades[<?=$sd->e_id?>][4]" value="" class="l_grades[<?=$sd->e_id?>][4]" />
										</td>
										<td><p class="<?=$sd->e_id . '_ave'; ?>">N/A</p></td>
										<td><input type="text" name="" id="" value="" /></td>
									<?endforeach;?>
								</tr>
								
							</tbody>
						</table>
						<input type="submit" class="button small success" value="Add Grades"/>
						<?=form_hidden('id_arr', $id_arr)?>
					</form>
				<?else: ?>
					<div class="notice">Oops! Can't retrieve students. Contact your admin.</div>
				<?endif;?>
			</fieldset>
		</div>
	<div>&nbsp;</div>
</div>